package yl.hs.bmipfull.controllers.finance;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import yl.hs.bmipfull.controllers.ControllerBase;
import yl.hs.bmipfull.service.finance.IFinanceSystemLogService;
import yl.hs.bmipfull.viewmodels.WebResult;

/**
 * @author 谢东
 * @apiNote
 * @since 2022/11/14 14:49 创建
 */
@Api(value = "财务管理--操作日志", tags = "财务管理——操作日志")
@RequestMapping(path = "/api/finance/log")
@RestController
public class FinanceSystemLogController extends ControllerBase {


    @ApiOperation(value = "查询操作日志", notes = "查寻操作日志")
    @RequestMapping(value = "/{dataSN}", method = RequestMethod.GET)
    public WebResult queryList(@ApiParam(value = "数据编号") @PathVariable String dataSN) {
        try {
            return success("查询成功", systemLogService.queryLogByMainSN(dataSN));
        } catch (Exception e) {
            return error(e);
        }
    }

    @Autowired
    public void setSystemLogService(IFinanceSystemLogService systemLogService) {
        this.systemLogService = systemLogService;
    }

    IFinanceSystemLogService systemLogService;
}
